#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>

int main()
{
int fd = open("/home/oven/oslab/hdc/var/buffer.txt",O_RDWR,0666);
	int i;
	int num;
	if(fd<0)
		{
		printf("Error: Fail to creat buffer!\n");
		exit(1);
	}
	
	for(i=0;i<10;i++)
	{
		read(fd,&num,sizeof(int));
		printf("num is %d\n",num);
	}
	return 0;
}